Skip to content

chore(github): push daily chart SVGs to chart-assets branch instead of main - #341

Merged
coder-hhx merged 2 commits into
Stack-Cairn:mainfrom
yyg-max:chore/chart-assets-branch
Aug 2, 2026
Merged

chore(github): push daily chart SVGs to chart-assets branch instead of main#341
coder-hhx merged 2 commits into
Stack-Cairn:mainfrom
yyg-max:chore/chart-assets-branch

Conversation

@yyg-max

@yyg-max yyg-max commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

The daily "Update Star History & Contributors" workflow commits regenerated chart
SVGs directly to main. Since branch protection now requires all changes to go
through a PR, that push is rejected and the workflow fails every day
(see run 30604986667). Beyond the failure, machine-generated daily commits also
pollute main's history (~365 commits/year of chart refreshes).

This PR moves the chart assets off main entirely:

  • The workflow now renders SVGs into $RUNNER_TEMP and force-pushes them to an
    orphan branch chart-assets as a single snapshot commit. The branch carries
    only the latest three SVGs — no history accumulates, and the branch is created
    automatically on first run.
  • Both READMEs reference the charts via
    https://raw.githubusercontent.com/Stack-Cairn/LiveAgent/chart-assets/<name>.svg,
    so main never needs another chart commit.
  • The now-unreferenced SVGs under docs/images/ are removed.

If a future run fails, the previous SVGs remain on the branch and the READMEs
keep showing yesterday's charts — no broken images.

Change scope

  • Modules: GitHub workflows + README docs (no product code)
  • Key paths:
    • .github/workflows/update-star-history.yml
    • README.md / README.zh-CN.md (chart image URLs)
    • docs/images/star-history-*.svg, docs/images/contributors.svg (deleted)

Screenshots / preview

N/A — the rendered README section is visually unchanged (same charts, same
light/dark handling); only the image source URLs move to the chart-assets
branch. Chart appearance itself is verifiable on the repo front page after the
first post-merge workflow run.

Verification

  • rg confirms no remaining references to the deleted docs/images SVGs
    anywhere in the repo.
  • Workflow logic reviewed: SVGs are generated into $RUNNER_TEMP (clean
    worktree before git switch --orphan), and the force-push is explicitly
    scoped to origin chart-assets; permissions unchanged (contents: write).
  • Post-merge steps: manually dispatch the workflow once to create the
    chart-assets branch (README images 404 until then), and confirm the branch
    protection ruleset matches main only so it does not block pushes to
    chart-assets.

Pre-submit checklist

  • A requirement issue is linked (or this is a trivial fix that needs no issue, as explained in the summary).
  • Synced with the target branch; no merge conflicts.
  • The change is focused, with no unrelated modifications.
  • No secrets, tokens, or personal data included.
  • Docs are updated for changes affecting user behavior, deployment, or configuration.

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

PR governance checks failed — this PR has been converted to draft.

  • No linked issue: the PR body must contain Closes #123 / Fixes #123 / Resolves #123. This project requires an issue before a PR — see the contribution guidelines.

Fix the items above, then click Ready for review to re-run the checks.

@yyg-max
yyg-max marked this pull request as draft July 31, 2026 16:31
@yyg-max
yyg-max marked this pull request as ready for review July 31, 2026 16:31
@yyg-max
yyg-max marked this pull request as draft August 2, 2026 06:24
@yyg-max
yyg-max marked this pull request as ready for review August 2, 2026 06:24
@StackCairn
StackCairn marked this pull request as draft August 2, 2026 06:24
@yyg-max yyg-max added the governance-exempt Skip PR governance checks label Aug 2, 2026
@yyg-max
yyg-max marked this pull request as ready for review August 2, 2026 06:25
@yyg-max
yyg-max requested review from coder-hhx and su-fen August 2, 2026 06:36

@coder-hhx coder-hhx left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@coder-hhx
coder-hhx merged commit 5c7ee61 into Stack-Cairn:main Aug 2, 2026
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

governance-exempt Skip PR governance checks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants